package com.hucheng.user.vo;

import com.hucheng.user.entity.UserDO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @Author: 凉白开不加冰
 * @Version: 0.0.1V
 * @Date: 2019-06-03
 * @Description: 返回界面数据
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserVO implements Serializable {
    private String accessId;
    private Integer userId;
    private String username;

    public static UserVO buildUserVO(final UserDO userDO) {
        if (userDO == null) {
            return null;
        }
        return new UserVO(null, userDO.getUserId(), userDO.getUsername());
    }
}
